package com.quick.service.impl;

import com.quick.domain.Weather;
import com.quick.domain.Yesterday;

import java.util.*;
import java.util.function.Function;

/**
 * @ClassName ttt
 * @Description TODO
 * @Author wangxin43
 * @Date 2018/4/24 上午10:36
 * @Version 1.0
 **/
public class ttt {
    public static void main(String[] args) {
        Function<Weather,Yesterday> tt  = (ss)->{
            Yesterday ww = new Yesterday();
            ww.setFl(ss.getAqi());
            return ww;
        };
        long a = 1525852814000L;
        long b = 1525853166000L;

        Yesterday y1 = new Yesterday();
        Yesterday y2 = new Yesterday();
        Date date1 = new Date(a);
        Date date2 = new Date(b);
        y1.setD(date1 );
        y2.setD(date2 );
        List<Yesterday> lll = new ArrayList<>();

        lll.add(y2);
        lll.add(y1);
        Collections.sort(lll, Comparator.comparing(Yesterday::getD));
        System.out.println(lll);

    }
}
